<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<MvcEngineModelItem<IPagination<User>>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>
        <%= Model.Localize("UsersPageTitle")%></title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="page-title" id="users-header">
        <h1>
            <%= Model.Localize("UsersPageHeader")%>
        </h1>
    </div>
    <div class="page-menu">
        <%= Html.UrlActionLink(Model.Localize("NewPageLink"), Url.NewPage())%>
    </div>
    <%= Html.Grid(Model.Item).Columns(column =>
    {
        column.For(x => Html.UrlActionLink(Html.Image(Url.ImagePath("edit.gif"), Model.Localize("EditAltText")), Url.EditUser(x.Id), false) +
        Html.PostActionLink(Html.Image(Url.ImagePath("delete.gif"), Model.Localize("DeleteAltText")), Url.DeleteUser(x.Id), Html.DeleteConfirmDialog(), false))
        .Header(Model.Localize("ActionsHeader")).DoNotEncode();
        column.For(x => x.Name).Header(Model.Localize("NameHeader"));
        column.For(x => x.Email).Header(Model.Localize("EmailHeader"));
        column.For(x => x.CreatedDate).Header(Model.Localize("CreatedDateHeader")).Format("{0:d}");
        column.For(x => x.ModifiedDate).Header(Model.Localize("ModifiedDateHeader")).Format("{0:d}");
    }).Attributes(cellSpacing => "0", cellPadding => "0", border => "0")
      .Footers(footer =>
      {
          footer.For(Model.Localize("PagesLabel") + Model.Item.TotalPages.GetPaging(p => Html.UrlActionLink(p.ToString(), Url.Users(p)) + "&nbsp;")).DoNotEncode().Attributes(colspan => "4");
          footer.For(string.Format(Model.Localize("TotalItems"), Model.Item.TotalItems));
    })%>
</asp:Content>
